﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using NMF.Utilities;

namespace NMF.Optimizations
{
    public class ModifiedScenario : ScenarioBase
    {
        private IOptimizationScenario baseScenario;
        private IOptimizationModification modification;

        public ModifiedScenario(IOptimizationScenario baseScenario, IOptimizationModification modification)
        {
            if (baseScenario == null) throw new ArgumentNullException("baseScenario");
            if (modification == null) throw new ArgumentNullException("modification");

            this.baseScenario = baseScenario;
            this.modification = modification;
        }

        public override IEnumerable<IOptimizationModification> AppliedModifications
        {
            get
            {
                foreach (var mod in baseScenario.AppliedModifications)
                {
                    yield return mod;
                }
                yield return modification;
            }
        }

        public override Optimization Optimization
        {
            get { return baseScenario.Optimization; }
        }
    }
}
